<?xml version="1.0" encoding="UTF-8"?>
<!--
  Created by IntelliJ IDEA.
  User: Nikita.Brazhnikov
  Date: 5/28/13
  Time: 2:00 PM
-->
<!DOCTYPE html
        PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/facelets"
      xmlns:c="http://java.sun.com/jsf/core"
      xmlns:pe="http://primefaces.org/ui/extensions"
        xmlns:p="http://primefaces.org/ui">

<h:head>
    <title>IGNORED</title>
</h:head>

<h:body>
    <f:composition>
        <h:outputScript>

            if (!logview) var logview = {};
            logview.processErrorStatus = function (error, response) {
                var errorName = error['error-name'];
                console.log(errorText);
                if (errorName.indexOf('ViewExpiredException')>-1) {
                    return true;
                } else {
                    var errorText = errorName + ": " + error['error-message'];
                    $('#ajax_error_contaiter').text(errorText);
                    return false;
                }
            }
            logview.clearErrorStatus = function() {
                $('#ajax_error_contaiter').text('');
            }
        </h:outputScript>
        <pe:ajaxErrorHandler onerror="return (function(err, resp){return logview.processErrorStatus(err,resp)})(error, response);"/>
        <pe:ajaxErrorHandler type="javax.faces.application.ViewExpiredException" title="Session expired"/>
        <p:ajaxStatus onsuccess="logview.clearErrorStatus();"/>
        <f:insert/>
    </f:composition>
</h:body>

</html>